<h1>Listing articles</h1>

<table>
  <thead>
    <tr>
      <th>Title</th>
      <th>Actions</th>
    </tr>
  </thead>

  <tbody>
    <% @articles.each_with_index do |article, index| %>
      <tr>
        <td><%= article.title %></td>
        <td>
          <a href="#" data-dropdown="drop<%= index %>" class="button small radius dropdown">Actions</a><br>
          <ul id="drop<%= index %>" data-dropdown-content class="f-dropdown">
            <li><%= link_to 'Show', article %></li>
            <li><%= link_to 'Edit', edit_article_path(article) %></li>
            <li><%= link_to 'Destroy', article, method: :delete, data: { confirm: 'Are you sure?' } %></li>
          </ul>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>

<br>

<%= link_to 'New Article', new_article_path, class: "button small radius" %>
